package datatypes.tv;

import java.util.ArrayList;
import java.util.List;

public class tvPrograms {
	List<tvProgram> tv_programs;

	public tvPrograms() {
		this.tv_programs = new ArrayList<tvProgram>();
	}
	
	public tvPrograms(tvProgram tv_program) {
		this.tv_programs = new ArrayList<tvProgram>();
		this.tv_programs.add(tv_program);
	}
	
	public tvPrograms(List<tvProgram> tv_program) {
		this.tv_programs = new ArrayList<tvProgram>();
		this.tv_programs.addAll(tv_program);
	}

	public void addProgram(tvProgram tv_program) {
		this.tv_programs.add(tv_program);
	}
 
	public List<tvProgram> getPrograms(){
		return this.tv_programs;
	}
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		int programIndex = 1;
		for(tvProgram tv_program : tv_programs){
			sb.append("program <" + programIndex++ + ">: \n");
			sb.append(tv_program.toString() + "\n");
		}

		return sb.toString();
	}
}
